package com.chixing.controller;

import com.chixing.service.CommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class TestController {

    @Autowired
    CommonService commonService;



    @GetMapping("/test/testAsync")
    @ResponseBody
    public String testAsync() {
        commonService.testAsync();
        return "http请求已结束";
    }

    @GetMapping
    public ModelAndView toIndex(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("/index.jsp");
        return modelAndView;
    }

}